<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="loanProductList.title"/></title>
    <meta name="menu" content="LoanProductMenu"/>
</head>

<c:if test="{'$'}{not empty searchError}">
    <div class="alert alert-danger alert-dismissable">
        <a href="#" data-dismiss="alert" class="close">&times;</a>
        <c:out value="{'$'}{searchError}"/>
    </div>
</c:if>
<!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        <fmt:message key="loanProductList.title"/>
        <small><p><fmt:message key="loanProductList.message"/></p></small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i><fmt:message key="loanProductList.heading"/></a></li>
        <li class="active"> <fmt:message key="loanProductList.heading"/></li>
    </ol>
</section>
<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <%@ include file="/common/messages.jsp" %>
            <div class="box">
                <div class="box-header">

                </div><!-- /.box-header -->
                <div class="box-body">
                    <%--<div id="actions" class="btn-group margin">
                        <a href='<c:url value="/loanProductform"/>' class="btn btn-primary">
                            <i class="fa fa-plus"></i> <fmt:message key="button.add"/></a>
                    </div>--%>

                    <display:table name="loanProductList" class="table table-bordered table-hover" requestURI="" id="loanProductList" export="true" pagesize="25">
                        <display:column property="productName" sortable="true" href="loanProductform?from=list" media="html"
                                        paramId="id" paramProperty="id" titleKey="loanProduct.productName"/>
                        <display:column property="id" media="csv excel xml pdf" titleKey="loanProduct.id"/>
                        <display:column property="bank.name" sortable="true" titleKey="loanProduct.bank"/>
                        <display:column sortable="true" titleKey="loanRequest.second">
                            <input type="checkbox" disabled="disabled" <c:if test="${loanProductList.second}">checked="checked"</c:if>/>
                        </display:column>
                        <display:column property="costRate" sortable="true" titleKey="loanProduct.costRate"/>
                        <display:column property="coef" sortable="true" titleKey="loanProduct.coef"/>
                        <display:column property="crLL" sortable="true" titleKey="loanProduct.crLL"/>
                        <display:column property="crUL" sortable="true" titleKey="loanProduct.crUL"/>
                        <display:column property="dpLL" sortable="true" titleKey="loanProduct.dpLL"/>
                        <display:column property="dpUL" sortable="true" titleKey="loanProduct.dpUL"/>
                        <display:column property="faLL" sortable="true" titleKey="loanProduct.faLL"/>
                        <display:column property="faUL" sortable="true" titleKey="loanProduct.faUL"/>
                        <display:column sortable="true" titleKey="loanProduct.loanYears">
                            <c:forEach var="year" items="${loanProductList.loanYears}" varStatus="status">
                                <fmt:message key="LOAN_YEARS_${year}"/><c:if test="${!status.last}">,</c:if>
                            </c:forEach>
                        </display:column>
                        <display:column sortable="true" titleKey="loanProduct.enabled">
                            <input type="checkbox" disabled="disabled" <c:if test="${loanProductList.enabled}">checked="checked"</c:if>/>
                        </display:column>

                        <display:setProperty name="paging.banner.item_name"><fmt:message key="loanProductList.loanProduct"/></display:setProperty>
                        <display:setProperty name="paging.banner.items_name"><fmt:message key="loanProductList.loanProducts"/></display:setProperty>

                        <display:setProperty name="export.excel.filename"><fmt:message key="loanProductList.title"/>.xls</display:setProperty>
                        <display:setProperty name="export.csv.filename"><fmt:message key="loanProductList.title"/>.csv</display:setProperty>
                        <display:setProperty name="export.pdf.filename"><fmt:message key="loanProductList.title"/>.pdf</display:setProperty>
                    </display:table>
                </div><!-- /.box-body -->
            </div><!-- /.box -->
        </div>
    </div>
</section><!-- /.content -->

<c:set var="scripts" scope="request">
    <script type="text/javascript">
        $(function () {
            $('#loanProductList').dataTable({
                "language": {
                    "url": "//cdn.datatables.net/plug-ins/1.10.7/i18n/Chinese.json"
                },
                "bPaginate": true,
                "bLengthChange": false,
                "bFilter": false,
                "bSort": true,
                "bInfo": false,
                "bAutoWidth": false
            });

        });
    </script>
</c:set>


